import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/home.vue'

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login'),
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('../views/register'),
    },
    {
        path: '/home',
        name: 'home',
        component: Home,
        redirect: '/ViewDiary',
        children: [
            {
                path: '/notebook',
                component: () => import('../page/NoteBook'),
            },
            {
                path: '/blog',
                component: () => import('../page/Blog'),
            },
            {
                path: '/sendBlog',
                component: () => import('../page/SendBlog'),
            },
            {
                path: '/viewDiary',
                component: () => import('../page/ViewDiary'),
            },
        ],
    },
    {
        name: 'about',
        path: '/about',
        component: () => import('../views/about'),
    },
    {
        name: 'information',
        path: '/information',
        component: () => import('../views/information'),
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router
